<?php

if (!defined("IN_FUSION")) { die("Access Denied"); }

define("THEME_WIDTH", "90%");
define("THEME_BULLET", "<img src='".THEME."images/bullet.gif' alt='' style='border:0' />");

require_once INCLUDES."theme_functions_include.php";

function render_page($license=false) {

	global $settings, $main_style, $locale;

	//Header
	echo "<center><table cellspacing='0' cellpadding='0' width='".THEME_WIDTH."' style='text-align:left;'>";
        echo "<tr>";
	echo "<td class='sub-header-left'></td>";
	echo "<td align='left' class='sub-header'>".showsublinks(" ", "white")."</td>";
	echo "<td align='right' class='sub-header'>".showsubdate()."</td>";
	echo "<td class='sub-header-right'></td>";
        echo "</tr>\n";
	echo "</table>\n";
	echo "<table cellspacing='0' cellpadding='0' width='".THEME_WIDTH."' style='text-align:left;'>\n";
        echo "<tr>\n";
	echo "<td class='body-left'><img src='".THEME."images/bg-left.png' width='62' height='299' alt='' style='border:0;margin:0;' /></td>";
        echo "<td class='header full-header' height= '126' valign='top'>".showbanners()."</td>";
        echo "<td class='body-right'><img src='".THEME."images/bg-right.png' width='62' height='299' alt='' style='border:0;margin:0;' /></td>";
	echo "</tr>\n";
	echo "</table></center>\n";

	//Content
	echo "<table cellspacing='0' cellpadding='0' width='".THEME_WIDTH."' class='outer-border center'>\n<tr>\n";
	echo "<td class='main-bg' valign='top'>".U_CENTER.CONTENT.L_CENTER."</td>";
	if (LEFT) { echo "<td class='side-border-left' valign='top'>".LEFT."</td>"; }
	if (RIGHT) { echo "<td class='side-border-right' valign='top'>".RIGHT."</td>"; }
	echo "</tr>\n";
	echo "</table>\n";
	
 	//Footer
	echo "<center><table cellpadding='0' cellspacing='0'  width='".THEME_WIDTH."'>";
	echo "<tr>";
	echo "<td class='sub-header-left'></td>\n";
	echo "<td align='left' class='sub-header'>".sprintf($locale['global_172'], substr((get_microtime() - START_TIME),0,4))."</td>\n";
	echo "<td align='center' class='sub-header'>".showcounter()."</td>\n";
	echo "<td align='right' class='sub-header'>Theme <b>Nautica</b> by <a target='_blank' title='seo service' href='http://www.seoxrumerservice.com'>seoxrumerservice</a> | <a target='_blank' title='Hosted Exchange 2010' href='http://www.apps4rent.com/'>Hosted Exchange 2010</a> </td>\n";
	echo "<td class='sub-header-right'></td>\n";
	echo "</tr>\n";
	echo "</table></center>\n";
	echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
	echo "<td align='center' class='main-footer'>".stripslashes($settings['footer']);
	if (!$license) { echo "<br />\n".showcopyright(); }
	echo "</td>\n</tr>\n";
        echo "</table>\n";

}

function render_news($subject, $news, $info) {

	echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
	echo "<td class='capmain-left'></td>\n";
	echo "<td class='capmain'>".$subject."</td>\n";
	echo "<td class='capmain-right'></td>\n";
	echo "</tr>\n";
	echo "</table>\n";
	echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr>\n";
	echo "<td class='border-left'><img src='".THEME."images/blank.gif' width='3' alt='blank.gif'  style='display:block; height:28px' /></td>";
	echo "<td class='main-body middle-border'>".$news."</td>\n";
	echo "<td class='border-right'><img src='".THEME."images/blank.gif' width='3' alt='blank.gif'  style='display:block; height:28px' /></td>";
	echo "</tr>\n<tr>\n";
	echo "<td class='form'><img src='".THEME."images/blank.gif' width='3' alt='blank.gif'  style='display:block; height:28px' /></td>";
	echo "<td align='center' class='news-footer middle-border'>\n";
	echo newsposter($info," &middot;").newsopts($info,"&middot;").itemoptions("N",$info['news_id']);
	echo "</td>\n";
	echo "<td class='form'><img src='".THEME."images/blank.gif' width='3' alt='blank.gif'  style='display:block; height:28px' /></td>";
	echo "</tr>\n";
	echo "</table>\n";

}

function render_article($subject, $article, $info) {

	echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
	echo "<td class='capmain-left'></td>\n";
	echo "<td class='capmain'>".$subject."</td>\n";
	echo "<td class='capmain-right'></td>\n";
	echo "</tr>\n";
	echo "</table>\n";
	echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr>\n";
	echo "<td class='border-left'><img src='".THEME."images/blank.gif' width='3' alt='blank.gif'  style='display:block; height:28px' /></td>";
	echo "<td class='main-body middle-border'>".($info['article_breaks'] == "y" ? nl2br($article) : $article)."</td>\n";
	echo "<td class='border-right'><img src='".THEME."images/blank.gif' width='3' alt='blank.gif'  style='display:block; height:28px' /></td>";
	echo "</tr>\n<tr>\n";
	echo "<td class='form'><img src='".THEME."images/blank.gif' width='3' alt='blank.gif'  style='display:block; height:28px' /></td>";
	echo "<td align='center' class='news-footer middle-border'>\n";
	echo articleposter($info," &middot;").articleopts($info,"&middot;").itemoptions("A",$info['article_id']);
	echo "</td>\n";
	echo "<td class='form'><img src='".THEME."images/blank.gif' width='3' alt='blank.gif'  style='display:block; height:28px' /></td>";
	echo "</tr>\n";
	echo "</table>\n";

}

function opentable($title, $collapse = false, $state = "on") {

	global $panel_collapse; $panel_collapse = $collapse;
	
	echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
	echo "<td class='capmain-left'></td>\n";
	echo "<td class='capmain'>$title</td>\n";
	if ($collapse == true) {
		$boxname = str_replace(" ", "", $title);
		echo "<td class='capmain' align='right'>".panelbutton($state, $boxname)."</td>\n";
	}
	echo "<td class='capmain-right'></td>\n";
	echo "</tr>\n";
	echo "</table>\n";
	echo "<table cellpadding='0' cellspacing='0' width='100%' class='spacer'>\n<tr>\n";
	echo "<td class='border-left'><img src='".THEME."images/blank.gif' width='3' alt='blank.gif'  style='display:block; height:28px' /></td>";
	echo "<td class='main-body'>\n";	
	if ($collapse == true) { echo panelstate($state, $boxname); }

}

function closetable() {

	global $panel_collapse;

	if ($panel_collapse == true) { echo "</div>\n"; }
	echo "</td>\n";
	echo "<td class='border-right'><img src='".THEME."images/blank.gif' width='3' alt='blank.gif'  style='display:block; height:28px' /></td>";		
	echo "</tr>\n";
	echo "</table>\n";

}

function openside($title, $collapse = false, $state = "on") {

	global $panel_collapse; $panel_collapse = $collapse;
	
	echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
	echo "<td class='scapmain-left'></td>\n";
	echo "<td class='scapmain'>$title</td>\n";
	if ($collapse == true) {
		$boxname = str_replace(" ", "", $title);
		echo "<td class='scapmain' align='right'>".panelbutton($state, $boxname)."</td>\n";
	}
	echo "<td class='scapmain-right'></td>\n";
	echo "</tr>\n";
	echo "</table>\n";
	echo "<table cellpadding='0' cellspacing='0' width='100%' class='spacer'>\n<tr>\n";
	echo "<td class='border-left'><img src='".THEME."images/blank.gif' width='3' alt='blank.gif'  style='display:block; height:28px' /></td>";
	echo "<td class='side-body'>\n";	
	if ($collapse == true) { echo panelstate($state, $boxname); }

}

function closeside() {
	
	global $panel_collapse;

	if ($panel_collapse == true) { echo "</div>\n"; }
	echo "</td>\n";
	echo "<td class='border-right'><img src='".THEME."images/blank.gif' width='3' alt='blank.gif'  style='display:block; height:28px' /></td>";
	echo "</tr>\n";
	echo "</table>\n";

}

?>